Attribute VB_Name = "Program"
Option Explicit

'TODO: Insert standard header

' Is the application in debug mode?
Private m_bIsDebug As Boolean

' Application settings
Private m_oSettings As Settings

'#Region Public Properties

Public Property Get IsDebug() As Boolean
    IsDebug = m_bIsDebug
End Property

' Summary:
'   Obtains the Circles.Settings instance containing the application
'   configuration information.
Public Property Get Settings() As Circles.Settings
    Set Settings = m_oSettings
End Property

'#End Region

'#Region Private Methods

' Summary:
'   Determines if the application is being executed in debug mode.
' Remarks:
'   The application is running in debug mode if the "debug" command line option
'   has been set. The results of this determination can be obtained via the
'   Program.IsDebug property.
Private Sub DetermineIfDebugMode()
    Dim Commands
    Commands = Split(Interaction.Command)
    
    Dim CommandOption
    For Each CommandOption In Commands
        If CommandOption = "debug" Then
            m_bIsDebug = True
            Exit For
        End If
    Next CommandOption
End Sub

' Summary:
'   Initialises the application configuration.
Private Sub InitialiseSettings()
    Set m_oSettings = New Circles.Settings
End Sub

' Summary:
'   Application entry point.
Private Sub Main()
    Randomize

    DetermineIfDebugMode
    InitialiseSettings

    Dim DisplayForm As New Display
    DisplayForm.Show
End Sub

'#End Region
